
export default class {
    init = (modelName, actionName) => {
        this.modelName = modelName;
        this.actionName = actionName;
    }

    // 表单修改后
    afterChangeForm = (formData, key) => {

    }

    // 修改表单值
    changeForm = (formData, key) => {
        this.models[this.modelName].set({
            formData: formData,
            changeKey: key
        });

        this.actions[this.actionName].afterChangeForm(formData, key);
    }

    // 切换表单状态
    toggleStatus = () => {
        const model = this.models[this.modelName];
        const status = model.get('status');

        this.models[this.modelName].set({
            status: status === 'edit' ? 'browse' : 'edit'
        });
    }
}